home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1990: Discy Business / Discy Business.2mg / DEV.CD / TOOLS / SAMPLES / HP / HP.ASM / IO.ASM < prev    next >
Encoding:
Assembly Source File  |  1989-03-24  |  3.3 KB  |  125 lines  |  [B0] Apple IIgs Source Code (0x0003)

  1.  
  2. ******************************************************************************
  3. *                                                                            *
  4. *         HodgePodge:  An example Apple IIGS Desktop application             *
  5. *                                                                            *
  6. *         Written in 65816 Assembler by the Apple IIGS Tools Team            *
  7. *  Modified by Ben Koning for "Programmer's Introduction to the Apple IIGS"  *
  8. *                                                                            *
  9. *             Copyright (c) 1986-87 by Apple Computer, Inc.                  *
  10. *                                                                            *
  11. *   ----------------------------------------------------------------------   *
  12. *                                                                            *
  13. * ASM65816 Code file "IO.ASM" -- Picture Load and Save stuff calling ProDOS  *
  14. *                                                                            *
  15. ******************************************************************************
  16.  
  17.  
  18.  
  19. ****************************************************************
  20. *
  21. * LoadOne
  22. *
  23. * Loads the picture whose path name is passed in
  24. *
  25. *     NamePtr
  26. *
  27. * to address passed in
  28. *
  29. *     PicDestIN
  30. *
  31. ****************************************************************
  32. LoadOne        START
  33.                using IOData
  34.  
  35.                _OPEN OpenParams
  36.                bcc cont1
  37.                jmp Error1
  38.  
  39. cont1          anop
  40.                lda OpenID
  41.                sta ReadID
  42.                sta CloseID
  43.  
  44.                _READ ReadParams
  45.                bcc cont2
  46.                jmp Error1
  47.  
  48. cont2          anop
  49.                _Close CloseParams
  50.  
  51.                clc
  52.                rts
  53.                end
  54.  
  55.  
  56. ****************************************************************
  57. *
  58. * SaveOne
  59. *
  60. * Saves the picture whose path name is passed in
  61. *
  62. *     NamePtr
  63. *
  64. * from address passed in
  65. *
  66. *     PicDestOUT
  67. *
  68. ****************************************************************
  69. SaveOne        START
  70.                using IOData
  71.  
  72.                lda NamePtr
  73.                sta NameC
  74.                sta NameD
  75.                lda NamePtr+2
  76.                sta NameC+2
  77.                sta NameD+2
  78.  
  79.                _Destroy DestParams
  80.  
  81.                lda #$c1                 ; SuperHires picture type
  82.                sta CType
  83.                lda #0                   ; standard type = 0
  84.                sta CAux
  85.  
  86.                _Create CreateParms
  87.                bcc cont0
  88.                jmp Error1
  89.  
  90. Cont0          _OPEN OpenParams
  91.                bcc cont1
  92.                jmp Error1
  93.  
  94. cont1          anop
  95.                lda OpenID
  96.                sta WriteID
  97.                sta CloseID
  98.  
  99.                _WRITE WriteParams
  100.                bcc cont2
  101.                jmp Error1
  102.  
  103. cont2          anop
  104.                _Close CloseParams
  105.  
  106.                clc
  107.                rts
  108.                end
  109.  
  110.  
  111.  
  112. ****************************************************************
  113. *
  114. * Error1 -- handle disk error during read or write
  115. *
  116. ****************************************************************
  117. Error1         START
  118.                using  IOData
  119.                pha
  120.                _Close CloseParams
  121.                pla
  122.                jsr    CheckDiskError
  123.                rts
  124.                END
  125.